1. Field of the Invention
The present invention relates to systems that facilitate manipulating objects within an object-oriented programming system. More specifically, the present invention provides a method and an apparatus for supporting cross-component references within an object-oriented programming system.
2. Related Art
Object-oriented programming systems enable programmers to create, modify and manipulate objects, which contain both code and data. These objects are often organized into related groups, which are referred to as “components”.
To facilitate the use of components, object-oriented programming systems often provide mechanisms to ensure that objects within components remain consistent with each other as they are updated.
Additionally, many object-oriented programming systems support “loose coupling”, which enables programmers to concurrently modify related components. Moreover, loose coupling allows applications to be developed by larger development teams. However, loose coupling also makes it harder to manage consistency between components.
For example, a problem can arise when a referenced object is deleted and re-imported. Suppose there exists a database table (component) called “EMP”, with columns “ID” and “DEPT_ID”. Also suppose that the column EMP.DEPT_ID contains a foreign-key which refers to the column “ID” in another database table (component) “DEPT”. Furthermore, suppose that the column ID is the unique-key for database table (component) DEPT. Note that if DEPT is deleted, its unique-key will also be deleted. However, because of loose coupling, the foreign-key contained in column EMP.DEPT_ID may not be updated to reflect this deletion. Moreover, if DEPT is subsequently re-imported, the foreign-key may still not be updated. Consequently, even after re-importing DEPT, the foreign-key contained in column EMP.DEPT_ID may continue to refer to a non-existent object.
Upon subsequent validation of the EMP object, the database may report an error because the foreign-key in column EMP.DEPT_ID does not refer to a valid unique-key. Consequently, the user may have to either delete the foreign key or change it to refer a new unique-key.
Similarly, problems can arise when a component is updated. For example, an update can cause information within a referencing component to be inconsistent with associated information in a referenced component.
Unfortunately, existing loosely coupled systems do not check for such inconsistencies, which can cause the system to fail. As a result, such inconsistencies are typically detected when it is too late, e.g., after a system failure.
Hence, what is needed is a method and an apparatus for managing consistency between components thereby avoiding the problems described above.